<template>
  <div class="certification-wrap">
        <div class="wrap-info" v-if="infoObj.auditStatus != 'y'">
            <div class="title">{{infoObj.auditStatus == 'w'?'待审核':'认证不通过'}}</div>
            <img src="../../images/certification.png" alt="">
            <div class="tip">{{infoObj.auditStatus == 'w'?'认证资料已提交':'您的资料有误，请保证提交资料的真实性'}}</div>
            <div class="text" v-if="infoObj.auditStatus == 'w'">正在审核您的资料，请耐心等待</div>
            <div class="text" v-if="infoObj.auditStatus == 'n'">重新提交认证审核</div>
        </div>
        <div class="wrap-success" v-if="infoObj.auditStatus == 'y'">
            <img src="../../images/certification1.png" alt="">
            <div class="title">认证通过</div>
            <div class="tip">您的资料已审核通过</div>
        </div>
      <div class="wrap-item">
          <div class="item-list box box-pack-between box-align-center">
              <div class="name">身份认证</div>
              <div class="value">{{dutyStr(infoObj.duty)}}</div>
          </div>
          <div v-if="infoObj.type != 'company'" class="item-list box box-pack-between box-align-center">
              <div class="name">真实姓名</div>
              <div class="value">{{infoObj.trueName}}</div>
          </div>
          <div class="item-list address box box-pack-between box-align-center">
              <div class="name">地区</div>
              <div class="value">{{infoObj.province}}{{infoObj.city}}{{infoObj.district}}</div>
          </div>
          <div v-if="infoObj.type != 'company'" class="item-list box box-pack-between box-align-center">
              <div class="name">医疗机构</div>
              <div class="value">{{infoObj.company}}</div>
          </div>
         <div v-if="infoObj.type == 'company'" class="item-list box box-pack-between box-align-center">
              <div class="name">联系人</div>
              <div class="value">{{infoObj.contactPerson}}</div>
          </div>
          <div v-if="infoObj.type == 'company'" class="item-list box box-pack-between box-align-center">
              <div class="name">联系电话</div>
              <div class="value">{{infoObj.contactPhone}}</div>
          </div>
      </div>
  </div>
</template>

<script>
let CONSTANT = require('../../../wechat/static/constant/constant.js'),
    common = require("../../../wechat/static/common/common.js"),
    wsService = require("../../../wechat/static/common/wechat-jsdk.js");
export default {
  data () {
    return {
        infoObj:'',
        identifyList: [
          {key: "doctor", value:"医生"},{key: "nurse", value:"护士"},{key: "recover_physical_therapist", value:"康复理疗师"},
          {key: "health_manager", value:"健康管理师"},{key: "apothecary", value:"药师"},{key: "hospital ", value:"医院"},{key: "clinic", value:"诊所"},
          {key: "drugstore", value:"药店"},{key: "medical_instrument_supplie", value:"医疗器械供应商"},
        ]
    }
  },
  mounted(){
     this.getInfo()
  },
  methods:{
      getInfo(){
        let  url = CONSTANT.URL.DOCTOR.CHECKDETAIL,
            param = {}
        common.requestAjax(url,{},param,(res)=>{
            if(res.status == 200){
                let data = res.data.bussData;
                this.infoObj = data;
                console.log(res)
            }else{

            }
        })
      },
      dutyStr(e){
          let str;
          this.identifyList.forEach((item)=>{
              if(item.key == e){
                  str = item.value
              }
          })
         return str;
      }
  }
}
</script>

<style lang="scss">
 .certification-wrap{
     height: 100%;
     background-color: #f4f4f4;
     .wrap-info{
         width: 100%;
         height: 3.14rem;
         background-color: #0063AE;
         text-align: center;
         font-size: .38rem;
         color: #fff;
         padding-top: .2rem;
         img{
             width: 1.02rem;
             height: 1.04rem;
             margin: .13rem auto 0rem;
         }
         .tip{
             font-size: .28rem;
             margin-bottom: .05rem;
             opacity: .5;
         }
         .text{
             font-size: .34rem;
             opacity: .8;
         }
     }
     .address{
         .weui-cell{
             padding-right: 0;
         }
     }
     .wrap-success{
         width: 100%;
         height: 3.14rem;
         background-color: #0063AE;
         padding-top: .2rem;
         text-align: center;
         img{
             width: 1.06rem;
             height: 1.06rem;
         }
         .title{
             font-size: .38rem;
             color: #fff;
         }
         .tip{
             font-size: .34rem;
             color: #fff;
             opacity: 0.8;
         }
     }
     .wrap-item{
         background-color: #fff;
         font-size: .32rem;
         color: #333;
         margin-top: .2rem;
         padding-left: .31rem;
         .item-list{
             height: .88rem;
             padding-right: .32rem;
             border-bottom: 1px solid #DEDEDE;
             .value{
                 color: #666666;
             }
             &:last-child{
                 border: 0px;
             }
         }
     }
 }
</style>
